package dashboard;
import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.*;

public class SearchServlet extends HttpServlet {
	
	private SearchController SC = new SearchController();
	
	public void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws IOException, ServletException {
		
		String querry = req.getParameter("SearchQuerry");
		
		req.getSession().setAttribute("SearchResults", SC.findUsers(querry));
		
		resp.sendRedirect("Favorites.jsp?action=searchresults");
    
	}

}
